package com.myteam.mystory.adapter;

import com.myteam.mystory.R;

import android.content.Context;
import android.content.res.TypedArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class HistoryAdapter extends ArrayAdapter<String> {
	private Context context;
	private String[] history_namestory;
	
	TextView tv_namestory;
	
	public HistoryAdapter(Context context, int resource, String[] objects) {
		super(context, resource, objects);
		this.context = context;
		history_namestory = new String[]{"adfasgf","agđgadf","agfdsagag","agfhagfd","agfag","agfah","agfahg","agah","aghadhf","agfah"};
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View rowView = inflater.inflate(R.layout.history_adapter, parent,false);
		tv_namestory = (TextView) rowView.findViewById(R.id.history_nameStory);
		tv_namestory.setText(history_namestory[position]);
		TypedArray a = context.obtainStyledAttributes(R.styleable.Gallery1);
		int mGalleryItemBackground = a.getResourceId(R.styleable.Gallery1_android_galleryItemBackground, 0);
		a.recycle();
		rowView.setBackgroundResource(mGalleryItemBackground);
		return rowView;
	}
}
